import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/login')
  },

  {
    path: '/',
    name: '/',
    component: () => import('../layout'),
    redirect: '/home',
    // redirect: '/ColumnManagement',
    children: [
      {
        path: 'home',
        name: 'home',
        component: () => import('../views/home')
      },
      // 栏目管理
      {
        path: '/column',
        redirect: '/column/ColumnManagement',
        name: 'column',
        children: [
          {
            path: 'ColumnManagement',
            name: 'ColumnManagement',
            component: () => import('@/views/ColumnManagement/index.vue')
          },
          {
            path: 'ModelManagement',
            name: 'ModelManagement',
            component: () => import('@/views/ColumnManagement/ModelManagement.vue')
          },
          {
            path: 'ColumnModel',
            name: 'ColumnModel',
            component: () => import('@/views/ColumnManagement/ColumnModel.vue'),
            meta: { hidden: true }
          },
          {
            path: 'ContentModel',
            name: 'ContentModel',
            component: () => import('@/views/ColumnManagement/ContentModel.vue'),
            meta: { hidden: true }
          },
          {
            path: 'AddMenu',
            name: 'AddMenu',
            component: () => import('@/views/ColumnManagement/AddMenu.vue'),
            meta: { hidden: true }
          },
          {
            path: 'EditMenu',
            name: 'EditMenu',
            component: () => import('@/views/ColumnManagement/EditMenu.vue'),
            meta: { hidden: true }
          }
        ]
      },

      // 内容管理
      {
        path: '/content',
        redirect: '/content/ContentManagementList',
        name: 'content',
        children: [
          {
            path: 'ContentManagementList',
            name: 'ContentManagementList',
            component: () => import('@/views/ContentManagement/index.vue')
          },
          {
            path: 'ContentType',
            name: 'ContentType',
            component: () => import('@/views/ContentManagement/ContentType.vue')
          },
          {
            path: 'AddContentManagement',
            name: 'AddContentManagement',
            component: () => import('@/views/ContentManagement/AddContentManagement.vue')
          },
          {
            path: 'EditContentManagement',
            name: 'EditContentManagement',
            component: () => import('@/views/ContentManagement/EditContentManagement.vue'),
            meta: { hidden: true }
          },
          {
            path: 'PreviewContentManagement',
            name: 'PreviewContentManagement',
            component: () => import('@/views/ContentManagement/PreviewContentManagement.vue'),
            meta: { hidden: true }
          }

        ]
      },

      // 模板管理
      {
        path: '/template',
        redirect: '/template/TemplateManagementList',
        name: 'template',
        children: [
          {
            path: 'TemplateManagementList',
            name: 'TemplateManagementList',
            component: () => import('@/views/TemplateManagement/index.vue')
          },
          {
            path: 'TemplateManagementSetting',
            name: 'TemplateManagementSetting',
            component: () => import('@/views/TemplateManagement/TemplateManagementSetting.vue')
          },
          // 资源列表
          {
            path: 'ResourceList',
            name: 'ResourceList',
            component: () => import('@/views/TemplateManagement/ResourceList.vue')
          }
        ]
      },

      // 首页图片
      {
        path: '/picture',
        redirect: '/picture/HomePicturePosition',
        name: 'picture',
        children: [
          {
            path: 'HomePictureApply',
            name: 'HomePictureApply',
            component: () => import('@/views/HomePicture/HomePictureApply.vue')
          },
          {
            path: 'HomePictureExamine',
            name: 'HomePictureExamine',
            component: () => import('@/views/HomePicture/HomePictureExamine.vue')
          },
          {
            path: 'HomePicturePosition',
            name: 'HomePicturePosition',
            component: () => import('@/views/HomePicture/HomePicturePosition.vue')
          },
          {
            path: 'HomePictureStatistics',
            name: 'HomePictureStatistics',
            component: () => import('@/views/HomePicture/HomePictureStatistics.vue')
          }
        ]
      },
      // 用户管理
      {
        path: '/user',
        redirect: '/user/UserManagementList',
        name: 'user',
        children: [
          {
            path: 'UserManagementList',
            name: 'UserManagementList',
            component: () => import('@/views/UserManagement/index.vue')
          },
          {
            path: 'RoleManagementList',
            name: 'RoleManagementList',
            component: () => import('@/views/UserManagement/RoleManagementList.vue')
          },
          {
            path: 'OrganizationManagementList',
            name: 'OrganizationManagementList',
            component: () => import('@/views/UserManagement/OrganizationManagementList.vue')
          },
          {
            path: 'MemberManagement',
            name: 'MemberManagement',
            component: () => import('@/views/UserManagement/MemberManagement.vue'),
            meta: { hidden: true }
          }
        ]
      },
      // 配置
      {
        path: '/disposition',
        redirect: '/disposition/OverallSituation',
        name: 'disposition',
        children: [
          {
            path: 'OverallSituation',
            name: 'OverallSituation',
            component: () => import('@/views/disposition/overall/index.vue')
          },
          {
            path: 'customTask',
            name: 'customTask',
            component: () => import('@/views/disposition/customTask/index.vue')
          },
          {
            path: 'homeStatic',
            name: 'homeStatic',
            component: () => import('@/views/disposition/homeStatic/index.vue')
          },
          {
            path: 'columnStatic',
            name: 'columnStatic',
            component: () => import('@/views/disposition/columnStatic/index.vue')
          },
          {
            path: 'contentStatic',
            name: 'contentStatic',
            component: () => import('@/views/disposition/contentStatic/index.vue')
          },
          {
            path: 'navigationStatic',
            name: 'navigationStatic',
            component: () => import('@/views/disposition/navigationStatic/index.vue')
          },
          {
            path: 'textSearch',
            name: 'textSearch',
            component: () => import('@/views/disposition/textSearch/index.vue')
          },
          {
            path: 'oneClickstatics',
            name: 'oneClickstatics',
            component: () => import('@/views/disposition/oneClickstatics/index.vue')
          },
          {
            path: 'siteManagement',
            name: 'siteManagement',
            component: () => import('@/views/disposition/siteManagement/index.vue')
          }
        ]
      },

      // 日志管理
      {
        path: '/log',
        redirect: '/log/OperationLogList',
        name: 'log',
        children: [
          {
            path: 'OperationLogList',
            name: 'OperationLogList',
            component: () => import('@/views/LogManagement/index.vue')
          },
          {
            path: 'SystemLogList',
            name: 'SystemLogList',
            component: () => import('@/views/LogManagement/SystemLogList.vue')
          }
          // {
          //   path: 'KnowledgeLogList',
          //   name: 'KnowledgeLogList',
          //   component: () => import('@/views/LogManagement/KnowledgeLogList.vue')
          // }
        ]
      },
      // 多媒体资源
      {
        path: '/multimedia',
        redirect: '/multimedia/MultimediaResourceList',
        name: 'multimedia',
        children: [
          {
            path: 'MultimediaResourceList',
            name: 'MultimediaResourceList',
            component: () => import('@/views/MultimediaResource/index.vue')
          }
        ]
      },
      // 个人中心
      {
        path: '/individual',
        redirect: '/individual/individualList',
        name: 'individual',
        children: [
          {
            path: 'individualList',
            name: 'individualList',
            component: () => import('@/views/Indivdual/index.vue')
          }
        ]
      },

      // 轮播图
      {
        path: '/carousel',
        redirect: '/carousel/carouselList',
        name: 'carousel',
        children: [
          {
            path: 'carouselList',
            name: 'carouselList',
            component: () => import('@/views/Carousel/index.vue')
          }
        ]
      },
      // 敏感词
      {
        path: '/sensitive',
        redirect: '/sensitive/sensitiveList',
        name: 'sensitive',
        children: [
          {
            path: 'sensitiveList',
            name: 'sensitiveList',
            component: () => import('@/views/Sensitive/index.vue')
          }
        ]
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
